

#import "RYTableData.h"


@implementation RYCellData

+ (id)cellWithDic:(NSMutableDictionary *)dicData {
    RYCellData *theCell = [[RYCellData alloc] init];
    theCell.dicData = dicData;
    return theCell;
}
@end



@implementation RYGroupData

- (id) init {
	if (self=[super init]) {
		self.allCells = [[NSMutableArray alloc] initWithCapacity:10];
		self.type = 0;
		self.title = nil;
		self.titleViewHeight = 0.0;
		self.footViewHeight = 0.0;
	}
	return self;
}

- (NSUInteger)count {
	return [self.allCells count];
}

- (void)addObject:(id)anObject {
	[self.allCells addObject:anObject];
}

- (id)objectAtIndex:(NSUInteger)index {
	if ( index < self.allCells.count )
		return [self.allCells objectAtIndex:index];
	return nil;
}

- (RYCellData *)addCellWithType:(int)cellType height:(int)cellHeight {
	RYCellData *theCell = [[RYCellData alloc] init];
	theCell.type = cellType;
	theCell.height = cellHeight;
	[self.allCells addObject:theCell];
	
	return theCell;
}

- (RYCellData *)addCell:(RYCellData *)theCell cellType:(int)cellType height:(int)cellHeight {
	theCell.type = cellType;
	theCell.height = cellHeight;
	[self.allCells addObject:theCell];
	
	return theCell;    
}

@end



@implementation PFTableData

- (id) init {
	if (self=[super init]) {
		self.allGroups = [[NSMutableArray alloc] initWithCapacity:2];
	}
	return self;
}

- (NSUInteger)count {
	return [self.allGroups count];
}

- (void)addObject:(id)anObject {
	[self.allGroups addObject:anObject];
}

- (id)objectAtIndex:(NSUInteger)index {
	if ( index < self.allGroups.count )
		return [self.allGroups objectAtIndex:index];
	return nil;
}

- (RYGroupData *)addGroupWithType:(int)groupType title:(NSString *)groupTitle {
	RYGroupData *theGroup = [[RYGroupData alloc] init];
	theGroup.type = groupType;
	theGroup.title = groupTitle;
	[self addObject:theGroup];
	
	return theGroup;
}

@end

